//
//  ZHFDestination.m
//  GoTraveling
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "ZHFDestination.h"

#import "ZHFData.h"

@implementation ZHFDestination

- (instancetype)init
{
    self = [super init];
    if (self) {
        _array = [NSMutableArray array];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"destinations"]) {
        
        for (NSDictionary *dic in value) {
            ZHFData *data = [ZHFData modelWithDictionary:dic];
            [self.array addObject:data];
        }
    }
    if ([key isEqualToString:@"category"]) {
        switch ([value integerValue]) {
            case 1:
                self.title = @"亚洲";
                break;
                
            case 2:
                self.title = @"欧洲";
                break;
                
            case 3:
                self.title = @"美洲、大洋洲、非洲";
                break;
                
            case 99:
                self.title = @"港澳台";
                break;
                
            case 999:
                self.title = @"大陆";
                break;
                
            default:
                break;
        }
    }
}






@end
